<template>
  <div>
    <el-form :model="form">
      <el-form-item>
        <el-input v-model="form.card"></el-input>
      </el-form-item>
      <el-form-item>
        <el-date-picker type="datetime" placeholder="请选择日期" v-model="form.datec" style="width: 100%"></el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="submitForm()">提交</el-button>
      </el-form-item>
    </el-form>
  </div>

</template>

<script>
import {save,getData} from "../../../api/api";
import moment from 'moment';
export default {
name: "dateTime",
  mounted() {
    let params={
    }
    console.log(params)
      getData(params).then((res=>{
          console.log(res)
        })).catch((res)=>{
          console.log(res)
        })
  },
  data(){
  return{
    form:{
      card:'',
      datec:''
    }
  }
  },
  methods:{
    submitForm(){
      let params={
        card:this.form.card,
        datec:moment(this.form.datec).format('YYYY-MM-DD HH:mm:ss')
        // datec:'2020-09-10 10:11:20'

      }
      console.log(params)
      save(params).then((res=>{
          console.log(res)
      })).catch((res)=>{
        console.log(res)
      })
    }
  }
}
</script>

<style scoped>

</style>